//
//  PolyvVideoViewFactory.m
//  flutter_polyv_plugin
//
//  Created by 蒋俊 on 2023/11/4.
//

#import "PolyvVideoViewFactory.h"
#import "PolyvVideoView.h"

@interface PolyvVideoViewFactory()
@property(nonatomic, strong) NSObject<FlutterBinaryMessenger> *messenger;
@end

@implementation PolyvVideoViewFactory

- (instancetype)initWithMessenger:(NSObject<FlutterBinaryMessenger>*)messenger {
    self = [super init];
    if (self) {
        self.messenger = messenger;
    }
    return self;
}

- (nonnull NSObject<FlutterPlatformView> *)createWithFrame:(CGRect)frame viewIdentifier:(int64_t)viewId arguments:(id _Nullable)args {
    return [[PolyvVideoView alloc] initWithFrame:frame
                                  viewIdentifier:viewId
                                       arguments:args
                                 binaryMessenger:_messenger];
}

@end
